Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: add blecent and bleprph similar to mynewt-nimble apps #2807

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maxikrie
Copy link

Summary

These example apps create a BLE central and peripheral based on mynewt-nimBLE and work in companion. The apps are mostly based on their equivalents, which can be found at https://github.com/apache/mynewt-nimble/tree/master/apps

Impact

Testing

These were successfully tested on two nrf52840-dk boards.

Copy link

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

Copy link

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

examples/nimble_blecent/misc.c Outdated Show resolved Hide resolved
examples/nimble_blecent/misc.c Outdated Show resolved Hide resolved
examples/nimble_blecent/misc.c Outdated Show resolved Hide resolved
examples/nimble_blecent/misc.c Outdated Show resolved Hide resolved
examples/nimble_blecent/misc.c Outdated Show resolved Hide resolved
@raiden00pl
Copy link
Member

why not modify the current nimble peripheral example (https://github.com/apache/nuttx-apps/blob/master/examples/nimble/nimble_main.c)? do we need 2 different examples for this?

@maxikrie
Copy link
Author

maxikrie commented Nov 1, 2024

why not modify the current nimble peripheral example (https://github.com/apache/nuttx-apps/blob/master/examples/nimble/nimble_main.c)? do we need 2 different examples for this?

I was debating this with myself. As stated, I based them on the mynewt-nimble apps and hence the peripheral is quite different from the existing one. I could, of course, modify the existing one losing the tight connection to the mynewt-nimble app. The other options are maintaining the existing one along side my contribution for legacy reasons, or purging the existing one (my preference). What do you think? @raiden00pl

@raiden00pl
Copy link
Member

raiden00pl commented Nov 1, 2024

@maxikrie The Mynewt coding standard is far from the NuttX coding standard, so the code will be a lot different anyway. Keeping 2 examples demonstrating the same functionality seems pointless to me. The easiest thing to do would be to change the name of existing examples/nimble to examples/nimble_bleprph (or nimble_prph) and add all your changes there.
Or you can delete examples/nimble but then you will have more work to adapt the Mynewt code to the NuttX coding standard.

@cederom
Copy link

cederom commented Nov 2, 2024

CI checkpatch is now fixed, CI restarted :-)

@cederom
Copy link

cederom commented Nov 2, 2024

@maxikrie
Copy link
Author

maxikrie commented Nov 23, 2024

@cederom Is there a way to check whether my changes will pass the check before committing? I read the documentation on pre-commit, but it seems that this only applies to the nuttx repository - at least this repository is missing the required .pre-commit-config.yaml.

I have installed pre-commit in the nuttx repository and tested it on branch nuttx-12.7.0, where everything is fine. I then naively tried from within the nuttx repository:
pre-commit run --files ../apps/*
which gives all sorts of strange errors.

@xiaoxiang781216
Copy link
Contributor

@cederom Is there a way to check whether my changes will pass the check before committing? I read the documentation on pre-commit, but it seems that this only applies to the nuttx repository - at least this repository is missing the required .pre-commit-config.yaml.

I have installed pre-commit in the nuttx repository and tested it on branch nuttx-12.7.0, where everything is fine. I then naively tried from within the nuttx repository: pre-commit run --files ../apps/* which gives all sorts of strange errors.

please run the following command to check the style:
../nuttx/tools/checkpatch.sh -g HEAD~...HEAD

@acassis
Copy link
Contributor

acassis commented Dec 20, 2024

ping @maxikrie

@maxikrie
Copy link
Author

maxikrie commented Jan 9, 2025

I fixed the formatting issues and fixed an error in the Makefile (I previously had only tested the CMake build), but there are again failed checks. Can somebody check? I am not sure what to make of them.. @xiaoxiang781216 @cederom

@cederom
Copy link

cederom commented Jan 9, 2025

Thank you @maxikrie :-)

Most of the formatting issues detected by CI are in the codebase already:
https://github.com/apache/nuttx-apps/actions/runs/12679172534/job/35340025084?pr=2807

Looks like these still needs an update?

  • the ones with comment.
  • builtin/builtin_list.c.
  • canutils/candump/candump.c

@maxikrie
Copy link
Author

maxikrie commented Jan 9, 2025

I am not sure, should I look into this? I am just checking since I didn't touch these and they didn't appear to be an issue when I run the nxstyle tool. I want to make sure this is not an issue with the CI.

@raiden00pl
Copy link
Member

raiden00pl commented Jan 10, 2025

does anyone have any idea why CI is returning nxstyle errors unrelated to PR content?

image

What is this Unchanged files with check annotations Preview ? any ideas @lupyuen @simbit18 @xiaoxiang781216 ?

@lupyuen
Copy link
Member

lupyuen commented Jan 10, 2025

@maxikrie Could you try rebasing with the latest master branch? The branch looks rather old (Oct 30).

Also the CI Check seems to be running OK for the latest builds. Thanks!

https://github.com/apache/nuttx-apps/actions/workflows/check.yml

@cederom
Copy link

cederom commented Jan 30, 2025

ping @maxikrie :-)

@maxikrie maxikrie force-pushed the feature/nimble_examples branch from 0cf8da4 to 7d778aa Compare February 7, 2025 18:23
@xiaoxiang781216
Copy link
Contributor

@maxikrie please sqaush your patch into by git rebase --interactive HEAD~8

Copy link
Contributor

@jerpelea jerpelea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be ok after squash

@cederom
Copy link

cederom commented Feb 10, 2025

Thank you @maxikrie, awesome work!! :-) Please squash so we have everything bundled into one single commit with common description and we are ready to go :-)

@maxikrie maxikrie force-pushed the feature/nimble_examples branch from 8e894d6 to 85c8350 Compare February 13, 2025 17:23
Copy link

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the squash @maxikrie just git commit -s missing and we are ready to go :-)

These example apps create a BLE central and peripheral based on
mynewt-nimBLE and work in companion. The apps are mostly based
on their equivalents, which can be found at
https://github.com/apache/mynewt-nimble/tree/master/apps

Fix formatting

Fix Makefiles

Format function parameters

Remove Doxygen comments

Add more function names and bug fix

Signed-off-by: Max Kriegleder <[email protected]>
@maxikrie maxikrie force-pushed the feature/nimble_examples branch from 85c8350 to c3db95a Compare February 13, 2025 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants